package com.qf.service.impl;

import com.qf.dao.AddressDao;
import com.qf.dao.impl.AddressDaoImpl;
import com.qf.domain.Address;
import com.qf.service.AddressService;

import java.util.List;

public class AddressServiceImpl implements AddressService {
    private AddressDao addressDao=new AddressDaoImpl();
    @Override
    public List<Address> selectByUserId(Integer uid) {
        return addressDao.findByUserId(uid);
    }

    @Override
    public void insertAddress(Address address) {
        addressDao.addAddress(address);
    }

    @Override
    public void deleteById(Integer uid, int aid) {
        addressDao.moveById(uid,aid);
    }

    @Override
    public void setDefault(Integer uid, int aid) {
        addressDao.setDefault(uid,aid);
    }

    @Override
    public void updateAddress(Address address) {
        addressDao.modifyAddress(address);
    }

    @Override
    public void deleteByUId(int uid) {
        addressDao.removeByUId(uid);
    }
}
